<template>
	<view>
		<view class="classify ">
			<view @click="on_view(index)" class="goods-li33" v-for="(item,index) in list" :key="index">
				<image class="b_y" style="width: 100%;height: 400rpx;" :src="item.shop_img"></image>
			</view>
		</view>
		<view v-if="islog" class="flex j-c a-c" style="height: 180rpx;background-color: #fff;">
			<image style="width: 50rpx;height: 50rpx;" src="@/static/icon/lo.gif"></image>
		</view>
		<view v-if="!islog&&list.length>10" class="flex j-c a-c" style="height: 180rpx;">
			<text class="f24 c_pl1">{{log}}</text>
		</view>

		<view v-if="!islog&&list.length==0" class="flex j-c a-c" style="height: 780rpx;">
			<view class="t_c">
				<view class="pb3">
					<text class="f24 c_pl1">暂无数据</text>
				</view>
				<text class="bicon c_pl1" style="font-size: 130rpx;">&#xe600;</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			options: {
				type: Object,
				default: function(e) {
					return {}
				}
			},
			list: {
				type: Array,
				default: function() {
					return [] //数据
				},
			},
			islog: {
				type: Boolean, //是否显示边框
				default: true
			},
			log: {
				type: String,
				default: ''
			},
			qiniu: {
				type: String,
				default: ''
			},
			tabindex: {
				type: Number,
				default: 0
			},
			ziduan: {
				type: String,
				default: 'id'
			},
			index: {
				type: Number,
				default: 0
			},
			time: {
				type: Number,
				default: 0
			},
			type: {
				type: Number,
				default: 0
			},
		},


		data() {
			return {
				lat: '',
				lng: '',


			}
		},
		mounted() {
			var pages = getCurrentPages()
			let currentRoute = pages[pages.length - 1].route;
			this.api_path = currentRoute.match(/pages\/(\S*)\//)[1];
			this.lat = uni.getStorageSync('lat')
			this.lng = uni.getStorageSync('lng')

		},


		methods: {
			on_edit(index) {
				uni.switchTab({
					url: '/pages/' + this.api_path + '/shop_add'
				})
			},
			on_del(index) {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '确认删除？',
					success: function(res) {
						if (res.confirm) {
							that.$emit('on_del', index)
						}
					}
				});
			},
			on_view(index) {

				var id = this.list[index][this.ziduan]
				uni.navigateTo({
					url: '/pages/' + this.api_path + '/shop_view?id=' + id
				})
			},
			on_tel(phone) {

				uni.makePhoneCall({
					phoneNumber: phone,
					success: function() {

					}

				})

			}

		}
	}
</script>

<style>
	.classify {
		display: flex;
		justify-content: flex-start;
		flex-wrap: wrap; 
	}
	.goods-li33 {
		flex: 0 0 32%;
		font-size: 24upx;
		margin: 5rpx;
		padding: 5rpx 5rpx 5rpx 10rpx;

	}
	
 
</style>